<?php
ob_start();
require_once '../sub/init.php';
require_once 'chkUadm.php';
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'sub/zeai_up_func.php';
if(!in_array('cert',$QXARR))exit(noauth());
$nav='index';
require_once ZEAI.'m/div_left_so.php';?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ulist{margin:70px auto 100px auto}
.ulist li{width:92%;margin:0 auto 20px auto;border-radius:8px;background-color:#fff;box-shadow:0 0 24px rgb(0 0 0 / 8%);position:relative;}
.ulist li .uidbox{padding:0 10px;margin:0 auto;line-height:40px;color:#999;border-bottom:#f5f5f5 1px solid;text-align:left}
.ulist li .uidbox .rzlist{float:left}
.ulist li .uidbox .rztitle{position:absolute;top:28px;right:10px;width:80px;line-height:24px;color:#fff;border-radius:16px 16px 50px 50px ;font-size:12px;text-align:center;color:#fff}
.ulist li .flagbox,.ulist li .flagboxed{width:80px;position:absolute;line-height:12px;top:10px;right:10px;text-align:center}
.ulist li .flagbox i,.ulist li .flagboxed i{font-size:12px;color:#f00}
.ulist li .flagboxed i,.ulist li .flagboxed{color:#45c01a;}
.ulist li .uidbox .RZBOX i{vertical-align:middle;font-size:14px;border-radius:3px;margin:0 2px;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.RZBOX .s {background-color:#ddd}
.ulist li .uinfo{padding:0 15px;text-align:left;position:relative;min-height:112px}
.ulist li .uinfo img.photo_s,.ulist li .uinfo img.path_b,.ulist li .uinfo img.path_b2{width:50px;height:50px;object-fit:cover;-webkit-object-fit:cover;position:absolute;left:15px}
.ulist li .uinfo img.photo_s{border-radius:50%;top:15px}
.ulist li .uinfo .uid{position:absolute;left:10px;top:68px;font-size:12px;text-align:left;color:#999}
.ulist li .uinfo .uid span{display:inline-block}
.ulist li .uinfo img.path_b,.ulist li .uinfo img.path_b2{width:60px;height:60px;left:125px;top:10px}
.ulist li .uinfo img.path_b2{left:195px}
.ulist li .uinfo .jt{position:absolute;left:80px;top:28px;text-align:center;font-size:18px;width:30px;color:#bbb}
.ulist li .uinfo .rztime{position:absolute;left:121px;top:72px;font-size:12px;color:#999;text-align:left}
.ulist li .uinfo .btn{position:absolute;right:12px}
.ulist li .uinfo .mod{top:5px;padding:0 9px;line-height:28px;height:28px;}
.ulist li .uinfo .yes{top:25px;background-color:<?php echo $_ADM['color'];?>}
.ulist li .uinfo .no{top:69px;background-color:#999}
.ulist li .datali{padding:10px;line-height:15px;border-top:#f5f5f5 1px solid;text-align:left;font-size:12px;position:relative}
.ulist li .datali span{display:inline-block;padding:5px;margin:5px 4px;border-radius:3px;box-shadow:0 0 4px rgb(0 0 0 / 9%);max-width:94%;word-wrap:break-word;}
.ulist li .datali span.weixin_pic{text-align:center}
.ulist li .datali span.weixin_pic img{width:30px;height:30px;object-fit:cover;-webkit-object-fit:cover}
.ulist li .datali .chkbox{position:absolute;right:10px;bottom:10px}
</style>
</head>
<body>
<?php
$SQL = "";
$Skey = trimhtml($Skey);
if (ifint($Skey)){
	$SQL = " AND (b.id=$Skey) ";
}elseif(!empty($Skey)){
	$SQL = " AND ( ( b.uname LIKE '%".$Skey."%' ) OR ( b.nickname LIKE '%".$Skey."%' ) OR ( b.nickname LIKE '%".urlencode($Skey)."%' ) )";
}
if (!empty($rzid))$SQL = " AND a.rzid='$rzid'";
if ($f=='f0'){
	$SQL .= " AND a.flag=0 ";
}elseif($f=='f1'){
	$SQL .= " AND a.flag=1 ";
}
//
$rtt = $db->query("SELECT COUNT(*) FROM ".__TBL_RZ__." a ,".__TBL_USER__." b WHERE a.uid=b.id ".$SQL);
$roww = $db->fetch_array($rtt);
//
$mini_title='认证管理（'.$roww[0].'）';$mini_class='top_mini4 ';
$mini_L = '<em onClick="zeai.openurl(\'m_adm.php\')"><i class="ico" >&#xeaca;</i><span></span></em>';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>
<form id="www_zeai_cn_FORM" class="ulist" method="get" action="<?php echo SELF; ?>">
	<?php
	$fieldlist  = "a.*,b.uname,b.nickname,b.sex,b.grade,b.love,b.pay,b.mob,b.photo_s,b.photo_f,b.birthday,b.area2title,b.house,b.car,b.edu,b.RZ,b.truename,b.identitynum";
	$rt = $db->query("SELECT ".$fieldlist." FROM ".__TBL_RZ__." a ,".__TBL_USER__." b WHERE a.uid=b.id ".$SQL."  ORDER BY a.addtime DESC LIMIT ".$_ADM['admLimit']);
	$total = $db->num_rows($rt);
	if ($total <= 0 ) {
		echo "<div class='nodataico'><i class='ico'>&#xe608;</i>暂无信息<br><br><a class='aBAI' href='javascript:history.back(-1)'>返回上一步</a></div>";
	} else {
		$page_skin=2;$pagemode='mob';$pagesize=8;require_once ZEAI.'sub/page.php';
		for($i=1;$i<=$pagesize;$i++) {
			$rows = $db->fetch_array($rt);if(!$rows) break;
			$id = $rows['id'];$uid = $rows['uid'];
			$uname = strip_tags($rows['uname']);
			$uname = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$uname);
			$nickname = trimhtml(dataIO($rows['nickname'],'out'));
			$nickname = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$nickname);
			$sex       = $rows['sex'];
			$grade     = $rows['grade'];
			$RZ        = $rows['RZ'];
			$rzid      = $rows['rzid'];
			$birthday  = $rows['birthday'];
			$love      = $rows['love'];
			$areatitle = $rows['area2title'];
			$pay       = $rows['pay'];
			$house     = $rows['house'];
			$car       = $rows['car'];
			$edu       = $rows['edu'];
			$flag      = $rows['flag'];
			$photo_s   = $rows['photo_s'];
			$path_b    = $rows['path_b'];
			$path_b2   = $rows['path_b2'];
			$bz        = dataIO($rows['bz'],'out');
			$truename  = dataIO($rows['truename'],'out');
			$identitynum= dataIO($rows['identitynum'],'out');
			$ifadm     = dataIO($rows['ifadm'],'out');
			$addtime   = YmdHis($rows['addtime'],'Ymd');
			if(empty($rows['nickname'])){
				$nickname = $uname;
			}
			$photo_s_url = (!empty($photo_s))?UP.smb($photo_s,'s'):RES.'photo_s'.$sex.'.png';
			if(!empty($path_b)){
				$path_b_url = $_ZEAI['up2'].'/'.$path_b;
			}else{
				$path_b_url = '';
			}
			if(!empty($path_b2)){
				$path_b2_url = $_ZEAI['up2'].'/'.$path_b2;
			}else{
				$path_b2_url = '';
			}
			$mob = strip_tags($rows['mob']);
			$mob = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$mob);
			$photo_fstr = ($photo_f == 0 && !empty($photo_s))?'<span>审核中</span>':'';
			$rz_str = RZ_html($RZ,'s','allcolor');
			?>
            <li id="tr<?php echo $id;?>">
				<div class="uidbox">
                    <div class="rzlist"><?php echo $rz_str;?></div>
                    <div class="<?php echo ($flag == 1)?'flagboxed':'flagbox';?>">
						<?php
						if ($flag == 1){
                            $icoo="<i class='ico'>&#xe67f; 审核通过</i>";
                        } else {
                            $icoo="<i class='ico'>&#xe65b; 未审或失败</i>";
                        }
                        echo $icoo;
                        ?>
                    </div>
                    <div class="rztitle" style="background-color:<?php echo rz_data_info($rzid,'color2');?>"><?php echo RZtitle($rzid);?></div>
                    <div class="clear"></div>
				</div>
				<div class="uinfo">
					<a href="javascript:ZeaiM.piczoom('<?php echo smb($photo_s_url,'b');?>');"><img class="photo_s" src="<?php echo $photo_s_url;?>"></a>
                    <div class="uid"><span>uid:<?php echo $uid;?></span><br><?php echo uicon($sex.$grade);?><?php echo $nickname;?></div>
					<i class="ico jt">&#xe62d;</i>
                    <?php if(!empty($path_b)){?>
                    	<a href="javascript:;" onClick="ZeaiM.piczoom('<?php echo $path_b_url; ?>');"><img class="path_b" src="<?php echo $path_b_url;?>"></a>
                    <?php }?>
                    <?php if(!empty($path_b2)){?>
                        <a href="javascript:;" onClick="ZeaiM.piczoom('<?php echo $path_b2_url; ?>');" ><img class="path_b2" src="<?php echo $path_b2_url;?>"></a>
                    <?php }?>
                    <div class="rztime"><?php echo $addtime; 
						if(!empty($ifadm)){
							echo '<br>操作人：'.$ifadm;
						}
						?>
            		</div>
                    <?php if ($flag == 0){?><a href="javascript:;" class="btn size2 yes flag1" id="<?php echo $id; ?>" nickname="<?php echo urlencode($nickname);?>">通过</a><?php }?>
                    <a href="javascript:;" class="btn size2 no flag0" id="<?php echo $id; ?>" nickname="<?php echo urlencode($nickname);?>">驳回</a>
				</div>
				<div class="datali">
					<?php 
                    switch ($rzid){
                        case 'identity':
                            echo '<span><font class="C999">姓名：</font>'.$truename.'</span>';
                            echo '<span><font class="C999">生日：</font>'.$birthday.'</span>';
                            echo '<span><font class="C999">身份证：</font>'.$identitynum.'</span>';
                            echo '<span><font class="C999">户籍地：</font>'.$areatitle;
                        break;
                        case 'photo':
                            echo '<span><font class="C999">姓名：</font>'.$truename.'</span>';
                            echo '<span><font class="C999">生日：</font>'.$birthday.'</span>';
                            echo '<span><font class="C999">身份证：</font>'.$identitynum.'</span>';
                            echo '<span><font class="C999">户籍地：</font>'.$areatitle.'</span>';
                        break;
                        case 'edu':
                            echo'<span><font class="C999">学历：</font>'.udata('edu',$edu).'</span>';
                        break;
                        case 'car':
                            echo '<span><font class="C999">汽车：</font>'.udata('car',$car).'</span>';
                        break;
                        case 'house':
                            echo'<span><font class="C999">房产：</font>'.udata('house',$house).'</span>';
                        break;
                        case 'love':
                            echo'<span><font class="C999">婚况：</font>'.udata('love',$love).'</span>';
                        break;
                        case 'pay':
                            echo'<span><font class="C999">月收入：</font>'.udata('pay',$pay).'</span>';
                        break;
                    }
					if(!empty($bz))echo '<span><font class="C999">备注：</font>'.$bz.'</span>';
                    ?>
                    <div class="chkbox">
                    <input type="checkbox" name="list[]" value="<?php echo $id; ?>" uid="<?php echo $uid; ?>" id="id<?php echo $id; ?>" class="checkskin"><label for="id<?php echo $id; ?>" class="checkskin-label"><i class="i1"></i></label>
                    </div>
                </div>
			</li>
			<?php
		}
	}
	?>
</form>
<script>var bg = '<?php echo $_Style['list_bg']; ?>',overbg   = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';</script>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="<?php echo SELF;?>" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="按UID/用户名/昵称" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		div_left_so_out(array('tbody'=>'审核状态','t'=>'f','tv'=>$f,'subkind'=>2,'newarr'=>json_decode('[{"i":"f0","v":"未审"},{"i":"f1","v":"已审"}]'),'ulcls'=>' col3'));
		$rz_data=explode(',',$_ZEAI['rz_data']);
		if (count($rz_data) >= 1 && is_array($rz_data)){
			foreach ($rz_data as $V){$rzarr[]=array('i'=>$V,'v'=>rz_data_info($V,'title'));}
			$rzarr = encode_json($rzarr);
			div_left_so_out(array('tbody'=>'认证类型','t'=>'rzid','tv'=>$rzid,'subkind'=>2,'newarr'=>json_decode($rzarr),'ulcls'=>' col3'));
		}
		?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<script>user_search.onclick=function(){ZeaiM.div_left({obj:user_so,w:28});}</script>
<!--div_left_so end-->

<?php if ($total > 0 ) {?>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<style>
.pagebox .pagesP,.pagebox .pagesN{border-radius:2px;border-color:#ddd}
.pagebox{padding-right:0;vertical-align:middle;float:right;margin-right:10px}
.pagebox .pageInfo select{border:0}
</style>
<div class="listbottombox">
	<input type="checkbox" id="checkboxall2" class="checkskin checkboxall"><label for="checkboxall2" class="checkskin-label"><i class="i1"></i></label>　
    <button type="button" id="btnflaglist" class="btn size2 zeaibg disabled action">通过</button>&nbsp;&nbsp;
    <button type="button" id="btndellist" class="btn size2 HEI2 disabled action">驳回</button>
	<?php if ($total > $pagesize)echo '<div class="pagebox">'.$pagelist.'</div>'; ?>
</div>
<script>
o('btndellist').onclick = function() {
	allList({
		btnobj:this,
		url:'cert'+zeai.ajxext+'submitok=flag0',
		title:'批量驳回',
		msg:'驳回处理中...',
		ifjson:true,
		ifconfirm:true
	});	
}
zeai.listEach('.flag0',function(obj){
	obj.onclick = function(){
		var id = parseInt(obj.getAttribute("id")),nickname=obj.getAttribute("nickname");
		zeai.confirm('确定要驳回【'+decodeURIComponent(nickname)+'】么？',function(){
			zeai.msg('正在驳回处理...',{time:300});
			zeai.ajax('cert'+zeai.ajxext+'submitok=flag0&list[]='+id,function(e){var rs=zeai.jsoneval(e);
				if (rs.flag == 1){location.reload(true);}else{zeai.msg(0);zeai.msg(rs.msg,{time:1});}
			});
		});
	}
});
o('btnflaglist').onclick = function() {
	allList({
		btnobj:this,
		url:'cert'+zeai.ajxext+'submitok=flag1',
		title:'批量审核',
		content:'',
		msg:'审核处理中...',
		ifjson:true,
		ifconfirm:true
	});	
}
zeai.listEach('.flag1',function(obj){
	obj.onclick = function(){
		zeai.confirm('确定要通过审核么？',function(){
			var id = parseInt(obj.getAttribute("id")),nickname=obj.getAttribute("nickname");
			zeai.msg('正在审核处理【'+decodeURIComponent(nickname)+'】',{time:300});
			zeai.ajax('cert'+zeai.ajxext+'submitok=flag1&list[]='+id,function(e){var rs=zeai.jsoneval(e);
				if (rs.flag == 1){location.reload(true);}else{zeai.msg(0);zeai.msg(rs.msg,{time:1});}
			});
		});
	}
});
</script>
<script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
</body></html><?php ob_end_flush();?>